This invention relates generally to computer systems and more particularly to computer systems having write-back caches.
As it is known in the art, certain I/O busses such as Digital Equipment Corporation's Q-bus.TM. have a short read latency timeout. A read latency timeout is defined as the longest period of time required by the system for satisfying a read request from an I/O device. For the Q-bus this read latency timeout is eight microseconds. Once an I/O device residing on the Q-bus does a read request transaction the requesting device waits for eight microseconds and if the requesting device hasn't received the data within this time period the requesting device assumes that there was a fault and declares a fatal error.
In some applications it is desirable to connect I/O busses having a short read latency timeout to a computer system including a Central Processor Unit (CPU) and a cache memory and in particular a write-back cache memory. Typical cache memory is relatively small, high-speed memory compared to main memory and is physically located close to ie processor. In systems using cache memory with a CPU, the cache memory is typically provided to hold data which is most likely to be used by the processor.
A CPU will retrieve data from main memory, perform some operation on the data and eventually write this data back to main memory. The performance of a system is effected by the number of times a CPU performs read and write type operations to main memory. In order to reduce the number of operations the CPU performs with main memory many CPUs incorporate various cache memory techniques.
One technique used is the incorporation of a write-back cache. A write-back cache improves the performance of a system by limiting the number of write transactions to main memory. If a CPU seeks to perform a write operation to main memory, and the location is located in this CPU's cache (a cache hit), then the cache location is written to and it now contains the latest version of the data for that memory location. This saves the CPU from performing a write operation to main memory and results in an increase in performance. If the CPU requests a write to a memory location that is not in the cache (a cache miss) then the write to main memory is performed, or optionally the location can be allocated into the cache and then the write can be done into the cache.
One drawback to write-back caches occurs when the CPU is required to perform a write-back operation. Should a read from either a second CPU or from an I/O device hit in the first CPU's cache then the first CPU will stall the read transaction requested by the second CPU or I/O device, write the current version of the data out from the first CPU's write-back cache to main memory where it can be accessed by the requesting CPU or I/O device, and then allow the original requested transaction to complete. In this manner the original read transaction takes a longer time to complete since it waits for the write-back operation to occur before it can access the desired data.
Proper system operation requires that the system be able to satisfy read requests from I/O devices in a period of time less than or equal to the worst case read latency timeout limit for the bus the I/O device resides on. Accordingly in some cases it is possible for a read latency timeout to occur while performing a write back operation caused by a different read operation. For example, if a read is requested from an I/O device residing on an I/o bus having a short read latency timeout, this read can stall due to a currently executing read transaction from a device on a different I/O bus. This currently executing read stalls because the location requested by the read hits in the CPU's write-back cache. In response, the CPU will perform a write-back operation. The stalled read from the device on the different I/O bus is allowed to finish, and the read requested by the I/O device residing on the I/O bus having a short read latency timeout is then able to start. However, the device requesting this read may have timed out before this read can complete, due to the long wait caused by the previous read which resulted in a write-back operation. Should this timeout take place a fatal error is declared, and system operation halts.